import numpy as np
import matplotlib.pyplot as plt
(kai_prise,gao_price,di_price,shou_price) = np.loadtxt('stock.csv',delimiter=',',usecols=(5,3,4,2),unpack=True,encoding='gb2312')

kai_prise= np.mean(kai_prise)
gao_price = np.mean(gao_price)
di_price = np.mean(di_price)
shou_price = np.mean(shou_price)
x = [kai_prise,gao_price,di_price,shou_price]
print(x)
bar_width = 0.3
t = np.arange(len(x))

plt.bar(t,x,tick_label=['a','b','c','d'],width=bar_width,color=['r','y','g','y'])


plt.show()
# np.savetxt("zhuzhuang_tu.csv",xx,delimiter=",",comments="",fmt="%.2f")